package decoder;

import com.alibaba.fastjson.JSON;

/**
 * @author 张照威
 * @date 2020/7/17
 * @mail 865533614@qq.com
 * @describe
 */
public class JSONSerializer implements Serializer{



    @Override

    public byte[] serialize(Object object) {

        return JSON.toJSONBytes(object);

    }



    @Override

    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }

}